import {
  getActivityList,
  getAddactData
} from "@/api/activityManage";

const activityManage = {
  state: {
    activitysearch: {
      gameId: "",
      status: "",
      onlineStatus:"",
      time: [],
      page: 1,
      limit: 20
    },
    
  },
  getters: {
    activitysearch: state => state.activitysearch,
  },
  mutations: {
    SET_SEARCH: (state, payload) => {
      state.activitysearch = payload;
    },
   
  },
  actions: {
    // 获取游戏列表
    getActivityList({
      commit
    }, reqData) {
      return new Promise(resolve => {
        getActivityList(reqData).then(response => {
          const data = response.data;
          resolve(data);
        });
      })
    },
    //   点击添加游戏获取关联游戏列表
    getAddactData({
      commit
    }, reqData) {
      return new Promise(resolve => {
        getAddactData(reqData).then(response => {
          const data = response.data;
          resolve(data);
        });
      })
    },
  }
}
export default activityManage
